﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Assignment5
{
    public class Goods
    {
        string Name { get; set; }
        int Price;
        public int getPrice() { return Price; }
        public Goods(string name, int price)
        {
            Name = name;
            Price = price;
        }
        //重写ToString方法
        public override string ToString()
        {
            return $"Goods name: {Name}, Price: {Price}";
        }
    }
}
